package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.EmpInfoRequireType;
import org.jsola.hr.constant.EmpInfoScene;

import javax.validation.constraints.NotNull;

import static org.jsola.hr.example.EmpContactsRequireExample.E_BIRTHDAY;
import static org.jsola.hr.example.EmpContactsRequireExample.E_COMPANY;
import static org.jsola.hr.example.EmpContactsRequireExample.E_COMPANY_ID;
import static org.jsola.hr.example.EmpContactsRequireExample.E_NAME;
import static org.jsola.hr.example.EmpContactsRequireExample.E_PHONE;
import static org.jsola.hr.example.EmpContactsRequireExample.E_POLITICAL_STATUS;
import static org.jsola.hr.example.EmpContactsRequireExample.E_POSITION;
import static org.jsola.hr.example.EmpContactsRequireExample.E_RELATION;
import static org.jsola.hr.example.EmpContactsRequireExample.E_REQUIRE_TYPE;
import static org.jsola.hr.example.EmpContactsRequireExample.M_BIRTHDAY_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpContactsRequireExample.M_COMPANY_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpContactsRequireExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.EmpContactsRequireExample.M_COMPANY_ID_NOT_NULL;
import static org.jsola.hr.example.EmpContactsRequireExample.M_NAME_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpContactsRequireExample.M_PHONE_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpContactsRequireExample.M_POLITICAL_STATUS_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpContactsRequireExample.M_POSITION_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpContactsRequireExample.M_RELATION_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpContactsRequireExample.M_REQUIRE_TYPE_ENUM_NOT_MATCH;
import static org.jsola.hr.example.EmpContactsRequireExample.M_REQUIRE_TYPE_MAX;
import static org.jsola.hr.example.EmpContactsRequireExample.M_REQUIRE_TYPE_NOT_NULL;
import static org.jsola.hr.example.EmpContactsRequireExample.N_BIRTHDAY;
import static org.jsola.hr.example.EmpContactsRequireExample.N_COMPANY;
import static org.jsola.hr.example.EmpContactsRequireExample.N_COMPANY_ID;
import static org.jsola.hr.example.EmpContactsRequireExample.N_NAME;
import static org.jsola.hr.example.EmpContactsRequireExample.N_PHONE;
import static org.jsola.hr.example.EmpContactsRequireExample.N_POLITICAL_STATUS;
import static org.jsola.hr.example.EmpContactsRequireExample.N_POSITION;
import static org.jsola.hr.example.EmpContactsRequireExample.N_RELATION;
import static org.jsola.hr.example.EmpContactsRequireExample.N_REQUIRE_TYPE;

/**
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【公司员工联系人所需信息】的参数")
@Data
public class EmpContactsRequireAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @NotNull(message = M_COMPANY_ID_NOT_NULL)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_REQUIRE_TYPE, example = E_REQUIRE_TYPE, required = true, allowableValues = EmpInfoScene.VALUES_STR)
    @NotNull(message = M_REQUIRE_TYPE_NOT_NULL)
    @Length(max = 20, message = M_REQUIRE_TYPE_MAX)
    @Const(constClass = EmpInfoScene.class, message = M_REQUIRE_TYPE_ENUM_NOT_MATCH)
    private String requireType;

    @ApiModelProperty(notes = N_NAME, example = E_NAME, allowableValues = EmpInfoRequireType.VALUES_STR)
    @Const(constClass = EmpInfoRequireType.class, message = M_NAME_ENUM_NOT_MATCH)
    private Integer name;

    @ApiModelProperty(notes = N_RELATION, example = E_RELATION, allowableValues = EmpInfoRequireType.VALUES_STR)
    @Const(constClass = EmpInfoRequireType.class, message = M_RELATION_ENUM_NOT_MATCH)
    private Integer relation;

    @ApiModelProperty(notes = N_BIRTHDAY, example = E_BIRTHDAY, allowableValues = EmpInfoRequireType.VALUES_STR)
    @Const(constClass = EmpInfoRequireType.class, message = M_BIRTHDAY_ENUM_NOT_MATCH)
    private Integer birthday;

    @ApiModelProperty(notes = N_PHONE, example = E_PHONE, allowableValues = EmpInfoRequireType.VALUES_STR)
    @Const(constClass = EmpInfoRequireType.class, message = M_PHONE_ENUM_NOT_MATCH)
    private Integer phone;

    @ApiModelProperty(notes = N_COMPANY, example = E_COMPANY, allowableValues = EmpInfoRequireType.VALUES_STR)
    @Const(constClass = EmpInfoRequireType.class, message = M_COMPANY_ENUM_NOT_MATCH)
    private Integer company;

    @ApiModelProperty(notes = N_POSITION, example = E_POSITION, allowableValues = EmpInfoRequireType.VALUES_STR)
    @Const(constClass = EmpInfoRequireType.class, message = M_POSITION_ENUM_NOT_MATCH)
    private Integer position;

    @ApiModelProperty(notes = N_POLITICAL_STATUS, example = E_POLITICAL_STATUS, allowableValues = EmpInfoRequireType.VALUES_STR)
    @Const(constClass = EmpInfoRequireType.class, message = M_POLITICAL_STATUS_ENUM_NOT_MATCH)
    private Integer politicalStatus;


}

